"""
import input as i

need user input a string
a=i.input_type()
a=i.input_type("str")
a=i.input_type("str","message")

need user input a integer
a=i.input_type("int")
a=i.input_type("int","message")

need user input a float
a=i.input_type("float")
a=i.input_type("float","message")
"""


def input_type(t: str = "str", s: str = ""):
    if (t != "int" and t != "float" and t != "str"):
        print("please set a type to the function")
        return
    if (s != "" and s[-1] != '\n'):
        s += '\n'
    a = input(s)
    try:
        if (t == "int"):
            return int(a)
        elif (t == "float"):
            return float(a)
        else:
            return a
    except ValueError:
        print("the type for input is error")
        if (t == "int"):
            return 0
        elif (t == "float"):
            return 0.0
        else:
            return ""
